package com.kefu.chat.vo;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.kefu.chat.model.ChatFaqGroup;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractUpdateVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;

@Data
public class ChatFaqGroupUpdateVo extends AbstractUpdateVo<ChatFaqGroup, String> {
    /**
     * 主键
     */
    @NotEmpty
    @ApiModelProperty(value = "主键")
    private String id;
    /**
     * 上级id
     */
    @ApiModelProperty(value = "上级id")
    private String parentId;
    /**
     * 分组名
     */
    @ApiModelProperty(name = "faqGroupName", value = "分组名")
    private String faqGroupName;
    /**
     * 等级
     */
    @ApiModelProperty(name = "faqGroupLevel", value = "等级")
    private Integer faqGroupLevel;

    /**
     * 备注
     */
    @ApiModelProperty(name = "faqGroupRemark", value = "备注")
    private String faqGroupRemark;
    @Override
    public ChatFaqGroup convert() {
        KefuContext context = KefuContext.getKefuContext();
        ChatFaqGroup info = BeanUtil.toBean(this, ChatFaqGroup.class);
        info.setUpdateTime(context.getNow());
        info.setUpdateUser(context.getUserId());
        info.setUpdateName(context.getUserName());
        return info;
    }
}
